package com.cetcs.kmga.dataManager.entity.dataManager.vo;

import com.cetcs.kmga.dataManager.entity.dataManager.vo.TodayNumberVo;
/**
 * 资源流量查询对象
 *
 * @author yyangs
 * @version V1.0 创建时间：2017-10-09 10:48
 * Copyright 2017 by CETC
 */
public class ResourceTrafficVo {

    //ID
    private int id;

    //资源名称
    private String name;

    //客户端IP数量
    private int clientIpAmout;

    //资源类型名称
    private String resrcTypeName;

    //资源IP地址
    private String ip;

    //数据读取量
    private TodayNumberVo outNum;

    //数据写入量
    private TodayNumberVo  inNum;

    //数据总量
    private TodayNumberVo  totalNum;

    public void resetNumState(){
        if(outNum != null) outNum.resetNumState();
        if(inNum != null) inNum.resetNumState();
        if(totalNum != null) totalNum.resetNumState();
    }


    /**
     * 构建数量对比对象
     * @param todayNum
     * @param avgNum
     * @return
     */
    public TodayNumberVo buildTodayNumberVo(double todayNum,double avgNum){
        TodayNumberVo ret = new TodayNumberVo();
        ret.setTodayNum(todayNum);
        ret.setAvgNum(avgNum);
        ret.resetNumState();
        return ret;
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getClientIpAmout() {
        return clientIpAmout;
    }

    public void setClientIpAmout(int clientIpAmout) {
        this.clientIpAmout = clientIpAmout;
    }

    public String getResrcTypeName() {
        return resrcTypeName;
    }

    public void setResrcTypeName(String resrcTypeName) {
        this.resrcTypeName = resrcTypeName;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public TodayNumberVo getOutNum() {
        return outNum;
    }

    public void setOutNum(TodayNumberVo outNum) {
        this.outNum = outNum;
    }

    public void setOutNum(double todayNum,double avgNum) {
        this.outNum = buildTodayNumberVo(todayNum,avgNum);
    }

    public TodayNumberVo getInNum() {
        return inNum;
    }

    public void setInNum(TodayNumberVo inNum) {
        this.inNum = inNum;
    }

    public void setInNum(double todayNum,double avgNum) {
        this.inNum = buildTodayNumberVo(todayNum,avgNum);
    }

    public TodayNumberVo getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(TodayNumberVo totalNum) {
        this.totalNum = totalNum;
    }

    public void setTotalNum(double todayNum,double avgNum) {
        this.totalNum = buildTodayNumberVo(todayNum,avgNum);
    }
}
